]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
brightnessManager: Move code around for the following commit
authorSebastian Wick <sebastian.wick@redhat.com>
Wed, 6 Aug 2025 08:52:46 +0000 (10:52 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 7 Aug 2025 21:57:54 +0000 (21:57 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3826>

js/misc/brightnessManager.js

index 3e2dca879df1717969d79593e5b812d8c5222119..a0402b9b4385ec53f06d7ec32350e135322eb1d7 100644 (file)
@@ -140,18 +140,6 @@ export const BrightnessManager = GObject.registerClass({
                     .some(m => m.get_backlight() && m.is_active());
             });
 
-        if (monitors.length === 0) {
-            this._globalScale = null;
-        } else if (!this._globalScale) {
-            this._globalScale = new BrightnessScale(_('Brightness'), 1.0);
-            this._globalScale.connect('notify::value', () => {
-                if (this._inhibitUpdates)
-                    return;
-                this._globalScaleChanged = true;
-                this._sync();
-            });
-        }
-
         this._monitorScales.clear();
 
         for (const monitor of monitors) {
@@ -170,6 +158,18 @@ export const BrightnessManager = GObject.registerClass({
             this._monitorScales.set(monitor, scale);
         }
 
+        if (monitors.length === 0) {
+            this._globalScale = null;
+        } else if (!this._globalScale) {
+            this._globalScale = new BrightnessScale(_('Brightness'), 1.0);
+            this._globalScale.connect('notify::value', () => {
+                if (this._inhibitUpdates)
+                    return;
+                this._globalScaleChanged = true;
+                this._sync();
+            });
+        }
+
         if (this._globalScale)
             this._sync({showOSD: false});